package com.dhcc.utils.object;

public abstract class BaseObjectCopier  {
	protected Class<?> targetType;
	protected Class<?> sourceType;
	protected String fields;
	protected int option;
	
	/**
	 * 检验当前处理类,是否支持
	 * @param target
	 * @param source
	 * @param fields
	 * @param option
	 * @return
	 */
	public boolean support(Object target, Object source, String fields,
			int option){
		if(this.option != option){
			return false;
		}
		if(!this.fields.equals(fields)){
			return false;
		}
		if(!targetType.isInstance(target)){
			return false;
		}
		if(!sourceType.isInstance(source)){
			return false;
		}
		return true;
	}
}
